import request from "@/utils/request";

// 查询来客访记列表
export function listVisitor(query) {
  return request({
    url: "/system/visitor/list",
    method: "post",
    data: query,
  });
}

// 查询来客访记详细
export function getVisitor(id) {
  return request({
    url: "/system/visitor/" + id,
    method: "get",
  });
}

// 新增来客访记
export function addVisitor(data) {
  return request({
    url: "/system/visitor",
    method: "post",
    data: data,
  });
}

// 修改来客访记
export function updateVisitor(data) {
  return request({
    url: "/system/visitor",
    method: "put",
    data: data,
  });
}

// 删除来客访记
export function delVisitor(id) {
  return request({
    url: "/system/visitor/" + id,
    method: "delete",
  });
}

// 导出来客访记
export function exportVisitor(query) {
  return request({
    url: "/system/visitor/export",
    method: "post",
    data: query,
  });
}

// 根据老人ID查询访客记录
export function getVisitorsByElderId(elderUserId) {
  return request({
    url: "/system/visitor/elder/" + elderUserId,
    method: "get",
  });
}
